﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Pharmacy.Entities;
using Pharmacy.Web.UI;
using Pharmacy.Data;

public partial class Page_PrescriptionDetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        FormUtil.RedirectAfterUpdate(GridView1, "PrescriptionDetail.aspx?page={0}");
        FormUtil.SetPageIndex(GridView1, "page");
        FormUtil.SetDefaultButton((Button)GridViewSearchPanel1.FindControl("cmdSearch"));
        PrescriptionDetail pre1 = DataRepository.PrescriptionDetailProvider.GetAll()[0];
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string prescriptionDetailId = e.CommandArgument.ToString().Trim();
        if (e.CommandName == "CustomDelete")
        {
           
                Pharmacy.Entities.PrescriptionDetail objPrescriptionDetail = new Pharmacy.Entities.PrescriptionDetail();
                objPrescriptionDetail.PrescriptionDetailId =Convert.ToInt64( prescriptionDetailId);
                DataRepository.PrescriptionDetailProvider.Delete(objPrescriptionDetail);
            
           
        }
    }
}
